/**
 * 新增和编辑
 */

import { Input, Modal, Form } from "antd";
// import type { TableProps, FormProps } from "antd";

type FieldType = {
  userId?: string;
  name?: string;
  nickname?: string;
  email?: string;
  phone?: string;
};

export const ModalIndex = ({title,userOpen,handleOk,handleCancel,basicForm}) => {
  return (
    <Modal
      title={title}
      open={userOpen}
      onOk={handleOk}
      onCancel={handleCancel}
      okText="确认"
      cancelText="取消"
    >
      <Form
        form={basicForm}
        labelCol={{ span: 6 }}
        wrapperCol={{ span: 18 }}
        style={{ maxWidth: 600 }}
        initialValues={{ remember: true }}
        autoComplete="off"
      >
        <Form.Item<FieldType>
          label="用户名"
          name="name"
          rules={[{ required: true, message: "请输入用户名!" }]}
        >
          <Input />
        </Form.Item>

        <Form.Item<FieldType> label="昵称" name="nickname">
          <Input />
        </Form.Item>

        <Form.Item<FieldType> label="邮箱" name="email">
          <Input />
        </Form.Item>

        <Form.Item<FieldType> label="电话" name="phone">
          <Input />
        </Form.Item>
      </Form>
    </Modal>
  );
};
